/**
 * <strong>Title : ReportServiceImpl.java<br>
 * </strong> <strong>Package : cn.b.sky.mes.mm.service.impl<br>
 * </strong> <strong>Description : </strong>@类注释说明写在此处@<br>
 * <strong>Create on : 2016年3月7日 上午10:12:29<br>
 * </strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 *          <strong>修改历史:</strong><br>
 *          修改人 | 修改日期 | 修改描述<br>
 *          -------------------------------------------<br>
 * <br>
 * <br>
 */
package cn.b.sky.mes.mm.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import cn.b.sky.mes.mm.dao.ReportDao;
import cn.b.sky.mes.mm.model.InOutBook;
import cn.b.sky.mes.mm.model.InventoryItemQuery;
import cn.b.sky.mes.mm.model.InventoryQuery;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import cn.b.sky.mes.mm.model.condition.InOutBookCondition;
import cn.b.sky.mes.mm.model.condition.InventoryItemQueryCondition;
import cn.b.sky.mes.mm.model.condition.InventoryQueryCondition;
import cn.b.sky.mes.mm.service.ReportService;

/**
 * <strong>Title : ReportServiceImpl.java<br></strong>
 * <strong>Package : cn.b.sky.mes.mm.service.impl<br></strong>
 * <strong>Description : </strong>报表业务实现<br> 
 * <strong>Create on : 2016年3月7日 上午10:12:29<br></strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 * <strong>修改历史:</strong><br>
 * 修改人    |    修改日期    |    修改描述<br>
 * <br>
 * <br>
 */
@Service("reportService")
public class ReportServiceImpl implements ReportService {
  @Resource
  ReportDao reportDao;

  @Override
  public List<InOutBook> selectInOutBookListByCondition(InOutBookCondition condition) {
    if (StringUtils.isBlank(condition.getOrderField())) {
      condition.setOrderField("CreateDateTime");
    }
    return reportDao.selectInOutBookListByCondition(condition);
  }

  @Override
  public int selectInOutBookCountByCondition(InOutBookCondition condition) {
    return reportDao.selectInOutBookCountByCondition(condition);
  }

  @Override
  public List<Map<String, Object>> selectAllInOutBookListByCondition(InOutBookCondition condition) {
    return reportDao.selectAllInOutBookListByCondition(condition);
  }

  @Override
  public List<InventoryQuery> selectInventoryListByCondition(InventoryQueryCondition condition) {
    if (StringUtils.isBlank(condition.getOrderField())) {
      condition.setOrderField("CreateDateTime");
    }
    return reportDao.selectInventoryListByCondition(condition);
  }

  @Override
  public int selectInventoryCountByCondition(InventoryQueryCondition condition) {
    return reportDao.selectInventoryCountByCondition(condition);
  }

  @Override
  public List<Map<String, Object>> selectAllInventoryListByCondition(InventoryQueryCondition condition) {
    if (StringUtils.isBlank(condition.getOrderField())) {
      condition.setOrderField("CreateDateTime");
    }
    return reportDao.selectAllInventoryListByCondition(condition);
  }

  @Override
  public List<InventoryItemQuery> selectInventoryItemListByCondition(InventoryItemQueryCondition condition) {
    if (StringUtils.isBlank(condition.getOrderField())) {
      condition.setOrderField("CreateDateTime");
    }
    return reportDao.selectInventoryItemListByCondition(condition);
  }

  @Override
  public int selectInventoryItemCountByCondition(InventoryItemQueryCondition condition) {
    return reportDao.selectInventoryItemCountByCondition(condition);
  }

  @Override
  public List<Map<String, Object>> selectAllInventoryItemListByCondition(InventoryItemQueryCondition condition) {
    if (StringUtils.isBlank(condition.getOrderField())) {
      condition.setOrderField("CreateDateTime");
    }
    return reportDao.selectAllInventoryItemListByCondition(condition);
  }

}
